package cn.portx.view;

import java.util.List;

import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import cn.portx.entity.Carrier;

import com.bstek.bdf3.dorado.jpa.JpaUtil;
import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.annotation.DataResolver;
import com.bstek.dorado.data.provider.Criteria;
import com.bstek.dorado.data.provider.Page;

@Component
public class CarrierPR {

	@Transactional(readOnly=true)
	@DataProvider
	public void loadCarrier(Page<Carrier> page,Criteria criteria){
		JpaUtil.linq(Carrier.class).where(criteria).paging(page);
	}
	
	@Transactional
	@DataResolver
	public void save(List<Carrier> carriers){
		JpaUtil.save(carriers);
	}
}
